//
//  ViewController.m
//  BookStore
//
//  Created by Mac on 15-12-4.
//
//

#import "ViewController.h"
#import "ReadViewController.h"
@interface ViewController ()
{
    NSMutableArray *bookName;
}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.title = @"书架";
    bookName =@[
            @"三毛流浪记"
            ].mutableCopy;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return bookName.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    cell.textLabel.text = bookName[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    ReadViewController *con = [ReadViewController new];
    con.text = @"哈哈";
    con.title = bookName[indexPath.row];
    [self.navigationController pushViewController:con animated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
